import lombok.extern.slf4j.Slf4j;
import online.longzipeng.Springboot2DemoApplication;
import online.longzipeng.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Author: lzp
 * @description: 事务注解踩坑记录
 * @Date: 2023/2/15
 */
@Slf4j
@SpringBootTest(classes = Springboot2DemoApplication.class,
		// 配置端口启动，否则获取失败
		webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class TransactionalDemo {
	@Autowired
	private UserService userService;

	@Test
	public void testDemo() throws Exception {
		userService.testTransaction();
	}


}
